<template>
  <div class="search-div-style">
    <MoreSearch :company_tag="company_tag" :company_data_in_search="company_data_in_search" :all_tags="all_tags"></MoreSearch>
  </div>
</template>

<script>
import MoreSearch from './MoreSearch'

export default {
  name: 'CompanySearch',
  components:{MoreSearch},
  data () {
    return {
      all_tags: [],
      company_tag:true,
      company_data_in_search:[],
    }
  },
  methods: {
    getRepeatNum() {
      return this.all_tags.reduce(function (prev, next) {
        prev[next] = (prev[next] + 1) || 1;
        return prev;
      }, {});
    }
  },
  created () {
    let _this = this
    setTimeout(function () {
      _this.all_tags = sessionStorage.getItem('all_enterprise_name').split('，')
      let temp = _this.all_tags
      _this.all_tags = []
      for(let key in temp){
        // console.log(temp)
        // console.log(temp[key])
        let temp3 = {'name':'','style':true}
        temp3.name =temp[key]
        _this.all_tags.push(temp3)
      }
      //console.log(_this.all_tags)

      _this.company_data_in_search = JSON.parse(sessionStorage.getItem('company_data_in_search'))
    }, 300)
    //console.log(_this.all_tags)
  }
}
</script>

<style scoped>

</style>
